const request = require("../../utils/request1.js")

Component({
  data () {
   
  },
  methods: {
    onLoad(options) {
      this.ChangeInformation()
    },
    // 更改个人信息
    ChangeInformation(){
        const _this = this
        request.wxRequest('user/edit', function (err, data) {
          if (err) {
            // 失败；
          } else {
            console.log('成功了');
          }
        }, 'POST', {
          id: 2,
          name:_this.data.name,
          image:'https://ts3.cn.mm.bing.net/th?id=OIP-C.LmYB_V97BlBjfRj8wKX44gAAAA&w=250&h=250&c=8&rs=1&qlt=90&o=6&dpr=1.6&pid=3.1&rm=2',
          mobile:_this.data.mobile
        })
    },
    onInputName(e) {
      console.log(e.detail.value);
      this.setData({
        name: e.detail.value
      });
    },
    // 获取手机号
    onInputMobile(e) {
      console.log(e.detail.value);

      this.setData({
        mobile: e.detail.value
      });
    },
  }
});
